# -*- coding: utf-8 -*-
import paho.mqtt.client as mqtt

mqttc = mqtt.Client("python_pub")
mqttc.connect("6nww.com", 1883)
mqttc.publish("task", "Hello, World! python_pub")
mqttc.loop(2) #//timeout = 2s
# mqttc.loop_forever()